<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>글목록</title>
<style type="text/css">
    body{
        line-height:2em;        
        font-family:"맑은 고딕";
}
    ul, li{ 
        list-style:none;
        text-align:center;
        padding:0;
        margin:0;
}

    #mainWrapper{
        width: 800px;
        margin: 0 auto; /*가운데 정렬*/
    }

    #mainWrapper > ul > li:first-child {
        text-align: center;
        font-size:14pt;
        height:40px;
        vertical-align:middle;
        line-height:30px;
         
}

    #ulTable	{margin-top:100px; /*  border:1px solid red; */}
    

    #ulTable > li:first-child > ul > li{ 
        background-color:#191919;
        font-weight:bold;
        text-align:center;
        color:#FFFFFF;
}

    #ulTable > li > ul {
        clear:both;
        padding:0px auto;
        position:relative;
        min-width:40px;	
       
}
    #ulTable > li > ul > li { 
        float:left;
        font-size:10pt;
        border-bottom:1px solid silver;
        vertical-align:baseline;
}    

    #ulTable > li > ul > li:first-child               {width:10%;} /*No 열 크기*/
    #ulTable > li > ul > li:first-child +li           {width:45%;} /*제목 열 크기*/
    #ulTable > li > ul > li:first-child +li+li        {width:20%;} /*작성일 열 크기*/
    #ulTable > li > ul > li:first-child +li+li+li     {width:15%;} /*작성자 열 크기*/
    #ulTable > li > ul > li:first-child +li+li+li+li{width:10%;} /*조회수 열 크기*/
    


    #divPaging {
          clear:both; 
        margin:0 auto; 
        width:220px; 
        height:50px;
}

    #divPaging > div {
        float:left;
        width: 30px;
        margin:0 auto;
        text-align:center;
}

    #liSearchOption {clear:both;}
    #liSearchOption > div {
        margin:0 auto; 
        margin-top: 30px; 
        width:auto; 
        height:100px; 

}

    .left {
        text-align : left;
}
#content{
/* 	border:1px solid green; */
        position:relative;
        height: 40px;
}
#content li { 
	display:inline;
	float:left;
	text-align:center;
        font-size:10pt;
        border-bottom:1px solid silver;
        vertical-align:baseline;
}
a.menu-red:link {
text-decoration: none;
color: #990000;
font-weight: bold;
}
a.menu-red:visited {
text-decoration: none;
color: #990000;
font-weight: bold;
}
a.menu-red:hover {
text-decoration: none;
color: #990000;
font-weight: bold;
}
a.menu-red:active {
text-decoration: none;
color: #990000;
font-weight: bold;
}

</style>
</head>
<body>
<div id="mainWrapper">
		
			<ul id="ulTable">
			<li>
			<ul>
			<li>NO</li>
			<li>제목</li>
			<li>이름</li>
			<li>작성일</li>
			<li>조회수</li>
			</ul>
			</li>
			
			<c:forEach var="bvo" items="${requestScope.lvo.list}">		
			<ul id="content">	
			<c:choose>
				<c:when test="${bvo.ref==1}">
			    <li style="width: 10%">${bvo.board_no }</li>				
				<li class="left" style="width: 45%" ><a href="${initParam.root}board/showContent.moja?no=${bvo.board_no }" class="menu-red">${bvo.board_title}</a><li>
				<li style="width: 20%">${bvo.member_id }</li>
				<li style="width: 15%">${bvo.board_time }</li>
				<li style="width: 10%">${bvo.viewcount }</li>
				</c:when>
				<c:otherwise>
				<li style="width: 10%">${bvo.board_no }</li>				
				<li class="left" style="width: 45%"><a href="${initParam.root}board/showContent.moja?no=${bvo.board_no }">${bvo.board_title}</a><li>
				<li style="width: 20%">${bvo.member_id }</li>
				<li style="width: 15%">${bvo.board_time }</li>
				<li style="width: 10%">${bvo.viewcount }</li>
				</c:otherwise>
				</c:choose>
			</ul>
			</c:forEach>
		
		

	<c:choose>
	<c:when test="${sessionScope.mvo.memberId==null}" >
	글쓰기는 로그인 후 가능합니다.
	</c:when>
	<c:otherwise>
	<a href="${initParam.root }board/auth_writeview.moja?"><img id="writeImg" src="${initParam.root }/img/write_btn.jpg" border="0"></a>
	</c:otherwise>
	</c:choose>

	<!-- 페이징 처리 -->		
	<br></br>	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<!-- 페이징 처리 -->	
	<%-- 이전 페이지 그룹이 있으면 이미지 보여준다.
		   이미지 링크는 현 페이지 그룹 시작페이지 번호 -1 =>
		   이전 페이지 그룹의 마지막 페	이지 번호로 한다. 
	 --%>
 	 <c:if test="${requestScope.lvo.pagingBean.previousPageGroup}">
	 <a href=
	 "getboardlist.moja?pageNo=${requestScope.lvo.pagingBean.
	 startPageOfPageGroup-1}"><img src="${initParam.root }/img/left_arrow_btn.gif"></a>
	 </c:if> 
 	<c:forEach var="i" 
	begin="${requestScope.lvo.pagingBean.startPageOfPageGroup}"
	 end="${requestScope.lvo.pagingBean.endPageOfPageGroup}">
	 <c:choose>
	 <c:when test="${requestScope.lvo.pagingBean.nowPage!=i}">
	 <a href="getboardlist.moja?pageNo=${i}">${i}</a>
	 </c:when>
	 <c:otherwise>
	${i}
	</c:otherwise>
	</c:choose>
	</c:forEach>	  
	&nbsp;&nbsp;
 	 <c:if test="${requestScope.lvo.pagingBean.nextPageGroup}">
	 <a href=
	 "getboardlist.moja?pageNo=${requestScope.lvo.pagingBean.
	 endPageOfPageGroup+1}">
	 <img src="${initParam.root }/img/right_arrow_btn.gif">
	 </a>
	 </c:if>		  
	 	</ul>
			</div>
</body>
</html>